import request from '@/utils/request'

// 查询订单BOM列表
export function listBom(query) {
  return request({
    url: '/bom/bom/list',
    method: 'get',
    params: query
  })
}

// 查询订单BOM详细
export function getBom(salesOrderNumber) {
  return request({
    url: '/bom/bom/' + salesOrderNumber,
    method: 'get'
  })
}

// 新增订单BOM
export function addBom(data) {
  return request({
    url: '/bom/bom',
    method: 'post',
    data: data
  })
}

// 修改订单BOM
export function updateBom(data) {
  return request({
    url: '/bom/bom',
    method: 'put',
    data: data
  })
}

// 删除订单BOM
export function delBom(salesOrderNumber) {
  return request({
    url: '/bom/bom/' + salesOrderNumber,
    method: 'delete'
  })
}

// BOM转工单
export function transferBomToWorkOrder(data) {
  return request({
    url: '/production/production',
    method: 'post',
    data: data
  })
}
